"""shop URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,re_path
from .views import index_views, list_views, info_views
urlpatterns = [
    re_path(r'^$', index_views.index, name='myhome_index'),
    #登录 退出
    re_path(r'^login/$', index_views.myhome_login, name='myhome_login'),
    re_path(r'^out/$', index_views.myhome_outlogin, name='myhome_out'),
    #注册
    re_path(r'^register/$', index_views.myhome_register, name='myhome_register'),
    re_path(r'^sendmsg/$', index_views.sendmsg, name='myhome_sendmsg'),

    # list
    re_path(r'^list/(?P<cid>[0-9]+)/(?P<bid>[0-9]+)/$', list_views.myhome_list, name='myhome_list'),
    re_path(r'^info/$', info_views.myhome_info, name='myhome_info'),

    # 购物车
    re_path(r'^addcar/$', info_views.addcar, name='myhome_car'),
    re_path(r'^carpage/$', info_views.carpage, name='myhome_carpage'),
    re_path(r'^caredit/$', info_views.caredit, name='myhome_caredit'),
    # 订单
    re_path(r'^confirm/$', info_views.confirm, name='myhome_confirm'),
    # 获取城市地址
    re_path(r'^getcitys/$', info_views.getcitys, name='myhome_getcitys'),
    # 存地址
    re_path(r'^saveaddress/$', info_views.saveaddress, name='myhome_saveaddress'),

    # 生成订单
    re_path(r'^createorder/$', info_views.createorder, name='myhome_createorder'),

]



